<?php if (!defined("_ECRIRE_INC_VERSION")) return; if (class_exists('AlohacartOrderStatutModel')) return;
/**
 * Aloha Cart
 *
 * @author     Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @license    GNU/GPL
 * @package    plugins
 * @subpackage alohacart
 * @copyright  (c) Aleksey Yaroshchuk 2011-2012
 * @link       http://www.spip-contrib.net/AlohaCart
 */

include_spip('classes/pdk_model');
/**
 *  Order Class
 *  This is alohacart order product model
 *
 *  @author Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 */
class AlohacartOrderStatutModel extends pdk_Model {
    public function __construct() {
        parent::__construct();
        $this->config_model();        
    }
    
    function config_model() {
        // Define main table:
        $this->main_table = 'spip_alohacart_orders_statuts';
        
        // Define primary key:
        $this->primary_key = 'id_statut';
        
        // Define main table fields:
        $this->main_fields['id_statut'] = 'id_statut'; 
        $this->main_fields['titre'] = 'titre';
                    
                                                                                 
         // Define validation rules:
         $this->validation->set_rules( 
            array(
               array(
                     'field'   => 'id_statut',
                     'label'   => 'ID statut',
                     'rules'   => 'required'
                  )
            )
         );                                       
    }
    
    // Define test data
    public $test_data = array(
        array('id_statut'=>1,'titre'=>'Status1'),
        array('id_statut'=>2,'titre'=>'Status2'),
        array('id_statut'=>3,'titre'=>'Status3'),
        array('id_statut'=>4,'titre'=>'Status4'),
        
    );
}
?>